package bishi.day11_5_6;

import java.util.Scanner;

/**
 * 最大连续二进制1
 *
 * @author 是阿秋啊
 * @date 2022/05/06 12:23
 **/
public class max1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int max = 0;
            while (n != 0) {
                int count = 0;
                while ((n & 1) == 1) {
                    count++;
                    n >>= 1;
                }
                max = Math.max(count, max);
                n >>= 1;
            }
            System.out.println(max);
        }
    }

}